package io.itit.ecp.admin.provide.action.resp;

import io.itit.ecp.admin.common.enums.ProductTypeActiveStatus;
import io.itit.grass.common.provide.action.resp.BaseResp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;


/**
 * <p>
 *
 * @Author：Roy
 * @Description：产品类型响应结果
 * @Date：Create by 2023-12-02 20:13:28
 */
@Data
@ToString
@ApiModel("产品类型响应结果")
public class ProductTypeResp extends BaseResp {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("产品编码")
    private String productTypeCode;

    @ApiModelProperty("产品名称")
    private String productTypeName;

    @ApiModelProperty("排序号")
    private Integer sort;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("机构Id")
    private String deptId;

    @ApiModelProperty("产品模型,多个用, 分隔")
    private String modelIds;

    @ApiModelProperty("启用状态(1:启用，0：禁用)")
    private String activeStatus;

    public String[] getModelIdArray() {
        if (StringUtils.isNotEmpty(this.modelIds)) {
            return this.modelIds.split(",");
        }
        return new String[0];
    }

    public String getActiveStatusName() {
        return ProductTypeActiveStatus.ENABLED.getValue().equals(this.activeStatus) ? ProductTypeActiveStatus.ENABLED.getLabel() :
                ProductTypeActiveStatus.DISABLED.getLabel();
    }


}
